Introduction

You can create Avatar videos using your custom audio. Additionally, you can adjust the Avatar using avatar_id and modify the voice with voice_id.


Step 1: Obtain sign_url and asset_id

You can upload media to obtain your sign_url and asset_id.

  • sign_url: Used as the address to upload media.

  • asset_id: Gets the address of the uploaded resource.

Please refer to the Upload Media for more details.

curl --request POST \
  --url https://api.jogg.ai/v1/upload/asset \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
--data-raw '{
    "filename":"1.jpg"
}'

You can upload pictures, videos, audio and other media resources.

Step 2: Use sign_url to upload the file

Use the following cURL command to upload the file to the server. Make sure to replace <file-binary-data> with the actual binary data of the file.

curl --location --request PUT '<sign_url>' \
--header 'Content-Type: application/octet-stream' \
--data-binary '<file-binary-data>'

Now asset_id is an available address to get resources.

Step 3: Use asset_id to get the file

Here’s an example:

curl --location --request POST 'https://api.jogg.ai/v1/create_video_from_talking_avatar' \
--header 'x-api-key: <your-api-key>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "audio_url": <your-audio-url>, //The media you upload.
    "aspect_ratio": 0,
    "screen_style": 1,
    "avatar_id": 127,
    "avatar_type": 0,
    "caption": true   
}'